<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html lang="zh">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>疫苗出入库明细统计</title>
<style media="print">
@page {
	size: auto; /* auto is the initial value */
	margin: 0mm; /* this affects the margin in the printer settings */
	margin: 20px 0 20px 0;
}

.PageNext {
	page-break-after: always;
}

.PageMargin {
	padding: 30px 0 0 0;
}
</style>
<style>
* {
	font-size: 14px;
	font-family: 'SimHei', 'SimSun';
}

body {
	width: 100%;
	margin: 0;
	padding: 0;
}

.wrap {
	padding: 0px 30px 0 30px;
}

.title {
	text-align: center;
	font-size: 1.8em;
	margin: 0 0 0 0;
}

.PageNo {
	display:table-footer-group;
	font-weight:bold;
	text-align: center;
}

table th, table td {
	vertical-align: middle;
	padding: 1px 20px;
}


.vacc-info, .tran-tool {
	width: 100%;
	border-collapse: collapse;
	border-spacing: 0;
	text-align: center;
	margin: 15px 0px 15px 0;
}

.vacc-info th, .tran-tool th {
	font-weight: normal;
	padding: 4px;
}

.tran-tool th {
	text-align: left;
}

.vacc-info td, .tran-tool td {
	font-size: 0.8em;
	padding: 4px;
}

.vacc-info-height td, .tran-tool td {
	height: 30px;
}


th span {
	bottom: -1px;
}

td span {
	margin-right: 4px;
	line-height: 26px;
	bottom: -2px;
}

.mr10 {
	margin-right: 10px;
}

.w50 {
	width: 50px;
	min-width: 50px;
}

.w70 {
	width: 70px;
	min-width: 70px;
}

.w100 {
	width: 100px;
	min-width: 100px;
}

.w130 {
	width: 130px;
	min-width: 130px;
}

.w170 {
	width: 170px;
	min-width: 170px;
}
</style>
</head>
<body>
	<div class="wrap PageNext">
		<p class="title">${inventoryDetail.storeName}出入库明细汇总信息数据
			（
			<fmt:formatDate value="${inventoryDetail.beginDate}"
				pattern="yyyy-MM-dd" />
			~
			<fmt:formatDate value="${inventoryDetail.endDate}"
				pattern="yyyy-MM-dd" />
			）
		</p>
		<br>
		<c:forEach items="${pageList}" var="page" begin="0" varStatus="status_page">
			<c:if test="${status_page.index != 0}"><div class="PageMargin"></div></c:if>
			<table border="1" class="vacc-info vacc-info-height">
				<tr>
					<th>序号</th>
					<th>疫苗名称</th>
					<th>生产企业</th>
					<th class = "w70">规格</th>
					<th>批号</th>
					<th>疫苗属性</th>
					<th>有效期</th>
					<th>出入库类型</th>
					<th>成本价</th>
					<th>出售价</th>
					<th>数量(支或粒)</th>
					<th>金额</th>
				</tr>
				<c:forEach items="${page}" var="details" begin="0" varStatus="status_list">
					<tr>
						<td>${status_page.index * 14 + status_list.index + 1 }</td>
						<td>${details.vaccName}</td>
						<td>${details.companyName}</td>
						<td><c:if test="${details.batchType eq '2' }">
							${details.spec}
						</c:if> <c:if test="${details.batchType eq '1' }">
							${details.dose},${details.doseType}
							${details.spec},${details.containerType}
						</c:if></td>
						<td>
							${details.batchNo}
							<c:if test="${not empty details.secondBatchno}">
						        -${details.secondBatchno}
						    </c:if>
						</td>
						<td>${fns:getDictLabel(details.cType, 'bs_vaccineInfo_type', '') }
						</td>
						<td><fmt:formatDate value="${details.outBoundDate}"
								pattern="yyyyMMdd" /></td>
						<td>
							${fns:getDictLabel(details.orderType,'bs_order_ordertype','')}<br>
							${fns:getDictLabel(details.orderStatus,'bs_order_status','')}
						</td>
						<td>￥${details.orignprice}</td>
						<td>￥${details.sellprice}</td>
						<td>${details.vaccNum}</td>
						<td>￥${details.vaccNumAmount}</td>
					</tr>
					<c:if test="${(status_page.index + 1) == pageList.size() && (status_list.index+1) == page.size()}">
						<c:if test="${status_list.index + 1 < 14 }">
							<tr>
								<td colspan="10" class="text-right">合计</td>
								<td>${amount1}</td>
								<td>${amount2}</td>
							</tr>
						</c:if>
					</c:if>
				</c:forEach>
			</table>
			<div class="PageNext"></div>
			<c:if test="${(status_page.index + 1) == pageList.size() &&  listNum%14 == 0 }">
				<c:if test="${status_page.index != 0}"><div class="PageMargin"></div></c:if>
				<table  border="1" class="vacc-info vacc-info-height">
				<tr>
					<th>序号</th>
					<th>疫苗名称</th>
					<th>生产企业</th>
					<th>规格</th>
					<th>批号</th>
					<th>疫苗属性</th>
					<th>有效期</th>
					<th>出入库类型</th>
					<th>成本价</th>
					<th>出售价</th>
					<th>数量(支或粒)</th>
					<th>金额</th>
				</tr>
				<tr>
					<td colspan="10" class="text-right">合计</td>
					<td>${amount1}</td>
					<td>${amount2}</td>
				</tr>
				</table>
			</c:if>
			
		</c:forEach>
	</div>
</body>
<script>
	window.print();
	setTimeout("top.opener=null;window.close()", 1);
</script>
</html>